{% extends 'templates/default_template.html' %}
{%block content%}
<h1>Projects list</h1>
  {%for p in projects%}
  <div class="projectElement">
    <p>{{p.name}}</p>
    {% ifequal p.leader.key logged_user.key %}
    <p><a href="/users/me">You</a> are the leader of this project</p>
    {% else %}
    <p>Leader: <a href="/users/{{p.leader.key}}">{{p.leader.name}}</a></p>
    {% endifequal %}
    <div class="elementOptions">
	<a href="/projects/{{p.key}}">View Project Details</a>
    </div>
  </div>
  {%endfor%}
  {% if not projects%}
  <div class="zeroHits">
    <p>The are no projects</p>
  </div>
  {% endif %}
{%endblock content%}